//
//  BingZhuangTu.m
//  BezierDemo
//
//  Created by yuanjiang on 2017/12/14.
//  Copyright © 2017年 yuanjiang. All rights reserved.
//

#import "BingZhuangTu.h"
#import "BZCircleModel.h"
#import "BZCircleRatioView.h"

#define PIE_HEIGHT 250
#define Radius 70.5 //圆形比例图的半径

@interface BingZhuangTu ()

/** view*/
@property(nonatomic,strong) BZCircleRatioView *circleView_one;

/** data*/
@property(nonatomic,strong) NSMutableArray *data1;

@property(nonatomic,strong) UILabel *label;

@property(nonatomic,strong) UIButton *button;

@end

@implementation BingZhuangTu

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"饼状图";
    self.view.backgroundColor = [UIColor whiteColor];
  
    [self.view addSubview:self.circleView_one];
    
//    [self.view addSubview:self.label];
//
//    [self.view addSubview:self.button];

}

-(UILabel *)label
{
    if (!_label) {
        _label = [[UILabel alloc] initWithFrame:CGRectMake(10, 600, 100, 30)];
        _label.text = @"的女儿快v";
        _label.layer.borderColor = [UIColor orangeColor].CGColor;
        _label.layer.borderWidth = 1;
    }
    return _label;
}

-(UIButton *)button
{
    if (!_button) {
        _button = [UIButton buttonWithType:UIButtonTypeCustom];
        _button.frame = CGRectMake(10, 550, 100, 30);
        [_button setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
        [_button setTitle:@"发的" forState:UIControlStateNormal];
    }
    return _button;
}



-(NSMutableArray *)data1
{
    if (!_data1) {
        _data1 = [NSMutableArray array];
        NSArray *colors = @[[UIColor redColor],[UIColor orangeColor], [UIColor blueColor]];
        NSArray *numbers = @[@"100",@"200",@"400"];
        NSArray *names = @[@"信托产品\n(买的+收益)",@"粤财汇\n(代收/冻结/可用金额+收益)",@"投资\n(三个公司投资总额+收益)"];
        for (int i = 0; i< numbers.count; i++) {
            BZCircleModel *model = [[BZCircleModel alloc] init];
            model.color = colors[i];
            model.number = numbers[i];
            model.name = names[i];
            [_data1 addObject:model];
        }
    }
    return _data1;
}

-(BZCircleRatioView *)circleView_one
{
    if (!_circleView_one) {
        _circleView_one = [[BZCircleRatioView alloc] initWithFrame:CGRectMake(0, 104, self.view.bounds.size.width, PIE_HEIGHT) dataAaary:self.data1 circleRadius:Radius];
        _circleView_one.backgroundColor = [UIColor lightGrayColor];
    }
    return _circleView_one;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
